<?
session_start();
include './config.inc.php';
include './uc_client/client.php';

setcookie("un",$_REQUEST['username'],time()+9999999,'/');

list($uid, $username, $password, $email) = uc_user_login($_REQUEST['username'], $_REQUEST['password']);
if($uid > 0) {
	$_SESSION['ucid'] = $uid;
	if($_REQUEST['face'] == '1'){header("Location:../mainpro/");}
	elseif($_REQUEST['face'] == '2'){header("Location:../mainpro/index_tea.php");}
	elseif($_REQUEST['face'] == '3'){header("Location:../rcenter/");}
	die();
} elseif($uid == -1) {
	header("Location:../index.htm?error=1");
} elseif($uid == -2) {
	header("Location:../index.htm?error=2");
} else {
	header("Location:../index.htm?error=3");
}

?>
